import {
    request
} from '../utils/request';

export async function fetchElderlyInfo(params) {
    return request({
        url: '/elderly/queryinfo_by_id',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchLogout(params) {
    return request({
        url: '/elderly/logOut',
        method: 'POST',
        data: {
            ...params
        }
    })
}

/*
    fetchOperationHistory,
    fetchMedicationHistory,
    fetchAllergyHistory,
    fetchFamilyHistory,
    fetchPastHistory

*/

export async function fetchOperationHistory(params) {
    return request({
        url: '/elderlyOperationHistory/queryinfo_by_id',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchMedicationHistory(params) {
    return request({
        url: '/elderlyMedicationHistory/queryinfo_by_id',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchAllergyHistory(params) {
    return request({
        url: '/elderlyAllergyHistory/queryinfo_by_id',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchFamilyHistory(params) {
    return request({
        url: '/elderlyFamilyHistory/queryinfo_by_id',
        method: 'POST',
        data: {
            ...params
        }
    })
}

export async function fetchPastHistory(params) {
    return request({
        url: '/elderlyMedicalHistory/queryinfo_by_id',
        method: 'POST',
        data: {
            ...params
        }
    })
}